package com.cjm.one.custom.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.SecurityConstants;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.custom.entity.CustomerLoginLog;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = ServerConstants.SERVER_ONE_CUSTOM)
public interface CustomerLoginLogClient {

    @PostMapping("/admin/customer/loginLog/add")
    @Operation(summary = "app添加登录日志")
    Result<Boolean> add(@RequestBody CustomerLoginLog customerLoginLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String fromSource);
    @GetMapping("/admin/customer/loginLog/list")
    Result<Page<CustomerLoginLog>> list(@RequestParam(name = "current",defaultValue = "1") Integer current,
                                               @RequestParam(name = "size",defaultValue = "10") Integer size,
                                               @RequestParam(name = "customerId") String customerId,
                                               @RequestParam(name = "startTime") String startTime,
                                               @RequestParam(name = "endTime") String endTime
    );
}
